<?php
/*include_once __DIR__.'/common/common.php';
function exception_dispose(Exception $exception)
{
    echo $exception->getMessage();
}
set_exception_handler('exception_dispose');//注册异常处理函数
$input=-10;
throw  new Exception('错误');*/
class workException extends Exception
{
    public function __construct($message = "", $code = 0, Throwable $previous = null)
    {
       // echo $message;
        parent::__construct($message, $code, $previous);
    }
}
class taskException extends Exception
{
    public function __construct($message = "", $code = 0, Throwable $previous = null)
    {
        //echo $message;
        parent::__construct($message, $code, $previous);
    }

}
try
{
    //工作上的逻辑代码
    try
    {
        throw new Exception('这是系统异常类');
    }catch (workException $workException)
    {
        echo '这里是work的异常';
    }

}catch (Exception $exception)
{
    echo $exception->getMessage();
}
